/*
 * Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The OpenAirInterface Software Alliance licenses this file to You under
 * the OAI Public License, Version 1.1  (the "License"); you may not use this
 * file except in compliance with the License. You may obtain a copy of the
 * License at
 *
 *      http://www.openairinterface.org/?page_id=698
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *-------------------------------------------------------------------------------
 * For more information about the OpenAirInterface (OAI) Software Alliance:
 *      contact@openairinterface.org
 */
/**
 * Nudr_DataRepository API OpenAPI file
 * Unified Data Repository Service. © 2020, 3GPP Organizational Partners (ARIB,
 * ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
 *
 * The version of the OpenAPI document: 2.1.2
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator
 * (https://openapi-generator.tech). https://openapi-generator.tech Do not edit
 * the class manually.
 */

#include "CommunicationCharacteristics.h"

namespace oai::udr::model {

CommunicationCharacteristics::CommunicationCharacteristics() {
  m_PpSubsRegTimerIsSet = false;
  m_PpActiveTimeIsSet = false;
  m_PpDlPacketCount = 0;
  m_PpDlPacketCountIsSet = false;
  m_PpDlPacketCountExtIsSet = false;
  m_PpMaximumResponseTimeIsSet = false;
  m_PpMaximumLatencyIsSet = false;
}

CommunicationCharacteristics::~CommunicationCharacteristics() {}

void CommunicationCharacteristics::validate() {
  // TODO: implement validation
}

void to_json(nlohmann::json &j, const CommunicationCharacteristics &o) {
  j = nlohmann::json();
  if (o.ppSubsRegTimerIsSet())
    j["ppSubsRegTimer"] = o.m_PpSubsRegTimer;
  if (o.ppActiveTimeIsSet())
    j["ppActiveTime"] = o.m_PpActiveTime;
  if (o.ppDlPacketCountIsSet())
    j["ppDlPacketCount"] = o.m_PpDlPacketCount;
  if (o.ppDlPacketCountExtIsSet())
    j["ppDlPacketCountExt"] = o.m_PpDlPacketCountExt;
  if (o.ppMaximumResponseTimeIsSet())
    j["ppMaximumResponseTime"] = o.m_PpMaximumResponseTime;
  if (o.ppMaximumLatencyIsSet())
    j["ppMaximumLatency"] = o.m_PpMaximumLatency;
}

void from_json(const nlohmann::json &j, CommunicationCharacteristics &o) {
  if (j.find("ppSubsRegTimer") != j.end()) {
    j.at("ppSubsRegTimer").get_to(o.m_PpSubsRegTimer);
    o.m_PpSubsRegTimerIsSet = true;
  }
  if (j.find("ppActiveTime") != j.end()) {
    j.at("ppActiveTime").get_to(o.m_PpActiveTime);
    o.m_PpActiveTimeIsSet = true;
  }
  if (j.find("ppDlPacketCount") != j.end()) {
    j.at("ppDlPacketCount").get_to(o.m_PpDlPacketCount);
    o.m_PpDlPacketCountIsSet = true;
  }
  if (j.find("ppDlPacketCountExt") != j.end()) {
    j.at("ppDlPacketCountExt").get_to(o.m_PpDlPacketCountExt);
    o.m_PpDlPacketCountExtIsSet = true;
  }
  if (j.find("ppMaximumResponseTime") != j.end()) {
    j.at("ppMaximumResponseTime").get_to(o.m_PpMaximumResponseTime);
    o.m_PpMaximumResponseTimeIsSet = true;
  }
  if (j.find("ppMaximumLatency") != j.end()) {
    j.at("ppMaximumLatency").get_to(o.m_PpMaximumLatency);
    o.m_PpMaximumLatencyIsSet = true;
  }
}

PpSubsRegTimer CommunicationCharacteristics::getPpSubsRegTimer() const {
  return m_PpSubsRegTimer;
}
void CommunicationCharacteristics::setPpSubsRegTimer(
    PpSubsRegTimer const &value) {
  m_PpSubsRegTimer = value;
  m_PpSubsRegTimerIsSet = true;
}
bool CommunicationCharacteristics::ppSubsRegTimerIsSet() const {
  return m_PpSubsRegTimerIsSet;
}
void CommunicationCharacteristics::unsetPpSubsRegTimer() {
  m_PpSubsRegTimerIsSet = false;
}
PpActiveTime CommunicationCharacteristics::getPpActiveTime() const {
  return m_PpActiveTime;
}
void CommunicationCharacteristics::setPpActiveTime(PpActiveTime const &value) {
  m_PpActiveTime = value;
  m_PpActiveTimeIsSet = true;
}
bool CommunicationCharacteristics::ppActiveTimeIsSet() const {
  return m_PpActiveTimeIsSet;
}
void CommunicationCharacteristics::unsetPpActiveTime() {
  m_PpActiveTimeIsSet = false;
}
int32_t CommunicationCharacteristics::getPpDlPacketCount() const {
  return m_PpDlPacketCount;
}
void CommunicationCharacteristics::setPpDlPacketCount(int32_t const value) {
  m_PpDlPacketCount = value;
  m_PpDlPacketCountIsSet = true;
}
bool CommunicationCharacteristics::ppDlPacketCountIsSet() const {
  return m_PpDlPacketCountIsSet;
}
void CommunicationCharacteristics::unsetPpDlPacketCount() {
  m_PpDlPacketCountIsSet = false;
}
PpDlPacketCountExt CommunicationCharacteristics::getPpDlPacketCountExt() const {
  return m_PpDlPacketCountExt;
}
void CommunicationCharacteristics::setPpDlPacketCountExt(
    PpDlPacketCountExt const &value) {
  m_PpDlPacketCountExt = value;
  m_PpDlPacketCountExtIsSet = true;
}
bool CommunicationCharacteristics::ppDlPacketCountExtIsSet() const {
  return m_PpDlPacketCountExtIsSet;
}
void CommunicationCharacteristics::unsetPpDlPacketCountExt() {
  m_PpDlPacketCountExtIsSet = false;
}
PpMaximumResponseTime
CommunicationCharacteristics::getPpMaximumResponseTime() const {
  return m_PpMaximumResponseTime;
}
void CommunicationCharacteristics::setPpMaximumResponseTime(
    PpMaximumResponseTime const &value) {
  m_PpMaximumResponseTime = value;
  m_PpMaximumResponseTimeIsSet = true;
}
bool CommunicationCharacteristics::ppMaximumResponseTimeIsSet() const {
  return m_PpMaximumResponseTimeIsSet;
}
void CommunicationCharacteristics::unsetPpMaximumResponseTime() {
  m_PpMaximumResponseTimeIsSet = false;
}
PpMaximumLatency CommunicationCharacteristics::getPpMaximumLatency() const {
  return m_PpMaximumLatency;
}
void CommunicationCharacteristics::setPpMaximumLatency(
    PpMaximumLatency const &value) {
  m_PpMaximumLatency = value;
  m_PpMaximumLatencyIsSet = true;
}
bool CommunicationCharacteristics::ppMaximumLatencyIsSet() const {
  return m_PpMaximumLatencyIsSet;
}
void CommunicationCharacteristics::unsetPpMaximumLatency() {
  m_PpMaximumLatencyIsSet = false;
}

} // namespace oai::udr::model
